<?php

namespace App\Jobs;

use App\Notifications\Wechat\OrderSuccess;

class OrderSuccessJob extends Job
{
    protected $userId;
    protected $paidAmount;
    protected $courseName;
    protected $tradeNo;
    protected $courseLevels;

    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct($userId, $paidAmount, $courseName, $tradeNo, $courseLevels)
    {
        $this->userId = $userId;
        $this->paidAmount = $paidAmount;
        $this->courseName = $courseName;
        $this->tradeNo = $tradeNo;
        $this->courseLevels = $courseLevels;
    }

    public function handle() {
        $orderSuccess = new OrderSuccess();
        $orderSuccess->notify(
            $this->userId,
            $this->paidAmount,
            $this->courseName,
            $this->tradeNo,
            $this->courseLevels
        );
    }

}
